﻿using System;

class CompareTwoArrays
{
   static bool AreEqual(string[] a, string[] b)
    {
        bool flag = true;     
            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] != b[i])
                {
                    flag = false;
                }
            }

            if ((a.Length == b.Length) && flag)
            {
                return true;
            }
            return false;
    }

    static void Main()
    {
        Console.WriteLine("Enter the length of array a:");
        int n = int.Parse(Console.ReadLine());
        Console.WriteLine("Enter the length of array b:");
        int m = int.Parse(Console.ReadLine());
        string[] arr = new string[n];
        string[] brr = new string[m];
        for (int i = 0; i < arr.Length; i++)
        {
            arr[i] = Console.ReadLine();
        }
        for (int i = 0; i < brr.Length; i++)
        {
            brr[i] = Console.ReadLine();
        }
        bool result = AreEqual(arr, brr);
        Console.WriteLine(result);
    }
}

